package com.itheima.anli;

import java.util.concurrent.*;

public class Test {
    public static void main(String[] args) {
        Acc acc = new Acc();

        //new Thread(acc,"小红").start();
        //new Thread(acc,"小明").start();
        ExecutorService pool = new ThreadPoolExecutor(
                2,
                5,
                100,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(3),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.DiscardOldestPolicy()
        );
        pool.execute(acc);
        pool.execute(acc);



    }
}
